package br.com.prime.control;

import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import br.com.prime.model.bussines.AlunoDAO;
import br.com.prime.model.bussines.EnderecoDAO;
import br.com.prime.model.bussines.MateriaDAO;
import br.com.prime.model.bussines.NotaDAO;
import br.com.prime.model.bussines.ProfessorDAO;
import br.com.prime.model.bussines.UsuarioDAO;
import br.com.prime.model.pojo.Aluno;
import br.com.prime.model.pojo.Endereco;
import br.com.prime.model.pojo.Materia;
import br.com.prime.model.pojo.Nota;
import br.com.prime.model.pojo.Professor;
import br.com.prime.model.pojo.Usuario;

@ManagedBean(name = "testeBean")
@SessionScoped
public class TesteBean {
	
	public void testeAluno(){
		AlunoDAO alunoDAO = new AlunoDAO();
		List<Aluno> alunos = alunoDAO.getAll();
		for (Aluno aluno : alunos) {
			System.out.println(aluno.getNOME());
		}
	}
	
	public void testeEndereco(){
		EnderecoDAO enderecoDAO = new EnderecoDAO();
		List<Endereco> enderecos = enderecoDAO.getAll();
		for (Endereco endereco : enderecos) {
			System.out.println(endereco.getRUA());
		}
	}
	
	public void testeMateria(){
		MateriaDAO materiaDAO = new MateriaDAO();
		List<Materia> materias = materiaDAO.getAll();
		for (Materia materia : materias) {
			System.out.println(materia.getNOME());
		}
	}
	
	public void testeNota(){
		NotaDAO notaDAO = new NotaDAO();
		List<Nota> notas = notaDAO.getAll();
		for (Nota nota : notas) {
			System.out.println(nota.getID_NOTA());
		}
	}
	
	public void testeProfessor(){
		ProfessorDAO professorDAO = new ProfessorDAO();
		List<Professor> professores = professorDAO.getAll();
		for (Professor professor : professores) {
			System.out.println(professor.getNOME());
		}
	}
	
	public void testeUsuario(){
		UsuarioDAO usuarioDAO = new UsuarioDAO();
		List<Usuario> usuarios = usuarioDAO.getAll();
		for (Usuario usuario : usuarios) {
			System.out.println(usuario.getLOGIN());
		}
	}
}